import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class MathBlackHole {
    public static void main(String[] args) {
//        String a = generateInt();
//        System.out.println(a);
        List<Integer> uniqueNumbers = generateUniqueRandomNumbers(5, 9);
        for (int number : uniqueNumbers) {
            System.out.println(number);
        }
    }

//    private static int[] generateIntArry(int number){
//
//    }
    private static String generateInt(){
        Random rand = new Random();
        String number = "";
        int randomNum = rand.nextInt(9) + 1;
        number += randomNum;
        for(int i=0;i<19;i++){
            randomNum = rand.nextInt(9) + 1;
            number += randomNum;
        }
        return number;
    }

    public static List<Integer> generateUniqueRandomNumbers(int count, int max) {
        List<Integer> numbers = new ArrayList<>();
        Random rand = new Random();

        while (numbers.size() < count) {
            int num = rand.nextInt(max)+1;
            if (!numbers.contains(num)) {
                numbers.add(num);
            }
        }

        return numbers;
    }
}
